<!DOCTYPE html>
<html ng-app="app" ng-controller="indexCtrl">

<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <title>广告投放-广告主</title>
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" id="favicon">
    <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="css/bootstrap-datetimepicker.min.css" />
    <link rel="stylesheet" href="css/base.css" />
    <link rel="stylesheet" href="modules/agent/agBaseInfo/agBaseInfo.css" />
    <link rel="stylesheet" href="../../oem/css/common.css" />
    <style>
        .hide {
            display: none;
        }
    </style>
</head>

<body>
        <div class="nav_top">
                <div class="logo fl" id="logo">
                </div>
                <ul class="nav_list fl">
                    <!-- ngIf: permission.view['首页'] -->
                    <li ng-if="permission.view['首页']" class="ng-scope"><a ui-sref="agent.home" ui-sref-active="active"
                            href="./agentIndex.html" class="" >首页</a></li><!-- end ngIf: permission.view['首页'] -->
                    <!-- ngIf: permission.view['投放管理'] -->
                    <li ng-if="permission.view['投放管理']" class="ng-scope">
                        <!--<a ui-sref="agent.delivery" ui-sref-active="active">投放管理</a>-->
                        <a href="./active.html" class="toFirstSub" >投放管理</a>
                        <ul class="nav_dropdown" style="width: 1903px;">
                            <!-- ngIf: permission.view['投放管理'].sub['活动管理'] -->
                            <li ng-if="permission.view['投放管理'].sub['活动管理']" class="ng-scope"><a href="./active.html"
                                    ui-sref-active="active" ui-sref="agent.delivery.active" class="" >活动管理</a></li>
                            <!-- end ngIf: permission.view['投放管理'].sub['活动管理'] -->
                            <!-- ngIf: permission.view['投放管理'].sub['订单管理'] -->
                            <li ng-if="permission.view['投放管理'].sub['订单管理']" class="ng-scope"><a href="./order.html"
                                    ui-sref-active="active" ui-sref="agent.delivery.order" class="" >订单管理</a></li>
                            <!-- end ngIf: permission.view['投放管理'].sub['订单管理'] -->
                            <!-- ngIf: permission.view['投放管理'].sub['素材信息'] -->
                            <li ng-if="permission.view['投放管理'].sub['素材信息']" class="ng-scope"><a href="./creative.html"
                                    ui-sref-active="active" ui-sref="agent.delivery.creative" class="" >素材信息</a></li>
                            <!-- end ngIf: permission.view['投放管理'].sub['素材信息'] -->
                            <!-- ngIf: permission.view['投放管理'].sub['APP监测'] -->
                            <li ng-if="permission.view['投放管理'].sub['APP监测']" class="ng-scope"><a href="./audiences.html"
                                    ui-sref-active="active" ui-sref="agent.delivery.audiences" class="" >监测管理</a></li>
                            <!-- end ngIf: permission.view['投放管理'].sub['APP监测'] -->
                            <!-- ngIf: hasDepot -->
                        </ul>
                    </li><!-- end ngIf: permission.view['投放管理'] -->
                    <!-- ngIf: permission.view['报表中心'] -->
                    <li ng-if="permission.view['报表中心']" class="ng-scope">
                        <!--<a ui-sref="agent.report" ui-sref-active="active">报表</a>-->
                        <a href="./baoBiao.html" class="toFirstSub"
                            ng-class="{'active':$state.includes('agent.report.*')}">报表中心</a>
                        <ul class="nav_dropdown" style="width: 1903px;">
                            <!-- ngIf: permission.view['报表中心'].sub['效果报表'] -->
                            <li ng-if="permission.view['报表中心'].sub['效果报表']" class="ng-scope"><a href="./baoBiao.html"
                                    ui-sref-active="active"
                                    ui-sref="agent.report.effect({'activeID':'0','activeName':'0','orderID':'0','orderName':'0'})"
                                    class="">效果报表</a></li><!-- end ngIf: permission.view['报表中心'].sub['效果报表'] -->
                                    <li ng-if="permission.view['合约报表'].sub['效果报表']" class="ng-scope">
							<a href="./heyuebaobiao.html" ui-sref-active="active" ui-sref="agent.report.effect({'activeID':'0','activeName':'0','orderID':'0','orderName':'0'})" class="">合约报表</a>
						</li>
                        
                        </ul>
                    </li><!-- end ngIf: permission.view['报表中心'] -->
                    <!-- ngIf: permission.view['系统管理'] -->
                    <li ng-if="permission.view['系统管理']" class="ng-scope">
                        <a href="./baseInfo.html" class="toFirstSub active"
                            ng-class="{'active':$state.includes('agent.manage.*')}">系统管理</a>
                        <ul class="nav_dropdown" style="width: 1903px;">
                            <!-- ngIf: permission.view['系统管理'].sub['基本信息'] -->
                            <li ng-if="permission.view['系统管理'].sub['基本信息']" class="ng-scope"><a href="./baseInfo.html"
                                    ui-sref-active="active" ui-sref="agent.manage.baseInfo" class="">基本信息</a></li>
                            <!-- end ngIf: permission.view['系统管理'].sub['基本信息'] -->
                            <!-- ngIf: permission.view['系统管理'].sub['资质管理'] -->
                            <li ng-if="permission.view['系统管理'].sub['资质管理']" class="ng-scope"><a href="./qualifications.html"
                                    ui-sref-active="active" ui-sref="agent.manage.qualifications" class="">资质管理</a></li>
                            <!-- end ngIf: permission.view['系统管理'].sub['资质管理'] -->
                        </ul>
                    </li><!-- end ngIf: permission.view['系统管理'] -->
                    <!-- ngIf: permission.view['财务管理'] -->
                    <li ng-if="permission.view['财务管理']" class="ng-scope">
                        <!--<a ui-sref="agent.finance" ui-sref-active="active">财务管理</a>-->
                        <a href="./caiwu.html" class="toFirstSub"
                            ng-class="{'active':$state.includes('agent.finance.*')}">财务管理</a>
                        <ul class="nav_dropdown" style="width: 1903px;">
                            <!-- ngIf: permission.view['财务管理'].sub['财务信息'] -->
                            <li ng-if="permission.view['财务管理'].sub['财务信息']" class="ng-scope"><a href="./caiwu.html"
                                    ui-sref-active="active" ui-sref="agent.finance.trade" class="">财务信息</a></li>
                            <!-- end ngIf: permission.view['财务管理'].sub['财务信息'] -->
                        </ul>
                    </li><!-- end ngIf: permission.view['财务管理'] -->
                </ul>
                <div class="user">
                    <div class="user-avatar"></div>
                    <div class="user-info">
                        <p ng-bind="advUser.loginName" class="ng-binding">昌投网络科技-C1</p>
                        <p ng-bind="advUser.name" class="ng-binding">上海昌投网络科技有限公司1</p>
                    </div>
                    <ul class="user-list">
                        <li class="ng-binding">余额：</li>
                        <li ng-show="permission.act['退出登录']" ng-click="logout()" class="">退出登录</li>
                    </ul>
                </div>
            </div>
    <ui-view class="ng-scope">
        <!-- uiView:  -->
        <ui-view class="ng-scope">
            <!-- uiView:  -->
            <ui-view class="ng-scope">
                <div class="aginfo-page page ng-scope">
                    <h3 class="page-title">基本信息</h3>
                    <div class="form">
                        <div class="form-title">
                            <span class="form-title-font">基本信息</span>
                            <!-- ngIf: obj.permission.act["基本信息"].sub["编辑"] --><i class="form-title-edit ng-scope"
                                onclick="change()"></i><!-- end ngIf: obj.permission.act["基本信息"].sub["编辑"] -->
                        </div>
                        <div class="form-group">
                            <label>账户名称：</label>
                            <div class="form-static ng-binding">北京卡瘦</div>
                        </div>
                        <div id="zhanShi">
                            <div class="form-group">
                                <label>公司名称：</label>
                                <div class="form-static ng-binding" id="show_adComapyName"></div>
                            </div>
                            <div class="form-group">
                                <label>公司网址：</label>
                                <div class="form-static ng-binding" id="show_adComapyUrl"></div>
                            </div>
                            <div class="form-group">
                                <label>公司地址：</label>
                                <div class="form-static ng-binding" id="show_adComapyAddress"></div>
                            </div>
                            <div class="form-group">
                                <label>联系人：</label>
                                <div class="form-static ng-binding" id="show_concat"></div>
                            </div>
                            <div class="form-group">
                                <label>手机号码：</label>
                                <div class="form-static ng-binding" id="show_phone"></div>
                            </div>
                            <div class="form-group">
                                <label>电话号码：</label>
                                <div class="form-static ng-binding" id="show_telephone"></div>
                            </div>
                            <div class="form-group">
                                <label>QQ：</label>
                                <div class="form-static ng-binding" id="show_qq"></div>
                            </div>
                        </div>
                        <div id="bianJi" class="hide">
                            <div class="form-group">
                                <label>公司名称：</label>
                                <input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-not-empty"
                                    ng-model="obj.info.name" id="adComapyName">
                            </div>
                            <div class="form-group">
                                <label>公司网址：</label>
                                <input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-not-empty"
                                    ng-model="obj.info.wwwUrl" id="adComapyUrl">
                            </div>
                            <div class="form-group">
                                <label>公司地址：</label>
                                <input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-not-empty"
                                    ng-model="obj.info.address" id="adComapyAddress">
                            </div>
                            <div class="form-group">
                                <label>联系人：</label>
                                <input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-not-empty"
                                    ng-model="obj.info.contacts" id="concat">
                            </div>
                            <div class="form-group">
                                <label>手机号码：</label>
                                <input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-not-empty"
                                    ng-model="obj.info.telephone" id="phone">
                            </div>
                            <div class="form-group">
                                <label>电话号码：</label>
                                <input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-empty"
                                    ng-model="obj.info.phone" id="telephone">
                            </div>
                            <div class="form-group">
                                <label>QQ：</label>
                                <input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-empty"
                                    ng-model="obj.info.qq" id="qq">
                            </div>
                            <div class="form-group">
                                <label> </label>
                                <button class="dsp-btn btn-blue" onclick="modify()">确定</button>
                                <button class="dsp-btn btn-gray" onclick="cancel1()">取消</button>
                            </div>
                        </div>
                        <!-- 修改密码 -->
                        <div ng-show="obj.permission.act[&quot;基本信息&quot;].sub[&quot;编辑密码&quot;]">
                            <div class="form-title">
                                <span class="form-title-font">密码信息</span>
                                <i class="form-title-edit" onclick="change1()"></i>
                            </div>

                            <div id="showPwd">
                                <div class="form-group">
                                    <label>密码：</label>
                                    <div class="form-static">******</div>
                                </div>
                            </div>

                            <div id="bianJiPwd" class="hide">
                                <div class="form-group">
                                    <label>旧密码：</label>
                                    <input type="password"
                                        class="form-control ng-pristine ng-untouched ng-valid ng-empty"
                                        ng-model="obj.pwd.oldPasswd" id="oldPwd">
                                </div>
                                <div class="form-group">
                                    <label>新密码：</label>
                                    <input type="password"
                                        class="form-control ng-pristine ng-untouched ng-valid ng-empty"
                                        ng-model="obj.pwd.newPasswd" id="newPwd">
                                </div>
                                <div class="form-group">
                                    <label>确认密码：</label>
                                    <input type="password"
                                        class="form-control ng-pristine ng-untouched ng-valid ng-empty"
                                        ng-model="obj.pwd.confirmPasswwd" id="confirmPwd">
                                </div>
                                <div class="form-group">
                                    <label> </label>
                                    <button class="dsp-btn btn-blue" onclick="confirm()">确定</button>
                                    <button class="dsp-btn btn-gray" onclick="cancel2()">取消</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </ui-view>
        </ui-view>
    </ui-view>



</body>

</html>
<script src="../res1.hubcloud.com.cn/lib/jquery/jquery.min.js"></script>
<script src="js/js_1.js"></script>
<script src="../res1.hubcloud.com.cn/lib/layer/layer.js"></script>
<script src="js/commen.js?rand=v1.0.54"></script>

<script>
    $(function () {
        queryInfo();
    })

    function change() {

        if ($('#zhanShi').hasClass("hide")) {
            $('#zhanShi').removeClass("hide");
            $('#bianJi').addClass("hide");
            // $(this).removeClass('open');
        } else {
            // $('.dropdown').removeClass('open');
            // $(this).addClass('open');
            $('#bianJi').removeClass("hide");
            $('#zhanShi').addClass("hide");
        }


    }

    function change1() {
        if ($('#showPwd').hasClass("hide")) {
            $('#showPwd').removeClass("hide");
            $('#bianJiPwd').addClass("hide");
            // $(this).removeClass('open');
        } else {
            // $('.dropdown').removeClass('open');
            // $(this).addClass('open');
            $('#bianJiPwd').removeClass("hide");
            $('#showPwd').addClass("hide");
        }
    }

    //查询基本信息
    function queryInfo(){

    
        let token=sessionStorage.getItem("token");
        $.ajax({
            url: url + "/advertiser/adUserInfo/queryInfo",
            type: 'GET',
            //		参数需转为字符串
            // data: JSON.stringify(d),
            //		json跨域
            dataType: 'json',
            //		contentType类型为json
            contentType: "application/json",

            //		请求头加上X-Token 
             beforeSend: function(XMLHttpRequest) {
                //		token 为页面所获取
                   
    			XMLHttpRequest.setRequestHeader("X-Token", token); 
            },
            useDefaultXhrHeader: false,
            success: function(result) {
                console.log(result);
                if(result.code == '0') {
                    let data=result.data;
                    $('#show_adComapyName').text(data.adComapyName);
                    $('#show_adComapyUrl').text(data.adComapyUrl);
                    $('#show_adComapyAddress').text(data.adComapyAddress);
                    $('#show_concat').text(data.concat);
                    $('#show_phone').text(data.phone);
                    $('#show_telephone').text(data.telephone);
                    $('#show_qq').text(data.qq);

                    $('#adComapyName').val(data.adComapyName);
                    $('#adComapyUrl').val(data.adComapyUrl);
                    $('#adComapyAddress').val(data.adComapyAddress);
                    $('#concat').val(data.concat);
                    $('#phone').val(data.phone);
                    $('#telephone').val(data.telephone);
                    $('#qq').val(data.qq);


                } else {
                    isErr(result);
                }
            },
            err: function(err) {
                layer.msg(result.msg);
            },
            complete: function() {
                
            }
        });

    }
    
    //编辑基本信息
    function modify(){

        let adComapyName=$('#adComapyName').val();
        let adComapyUrl=$('#adComapyUrl').val();
        let adComapyAddress=$('#adComapyAddress').val();
        let concat=$('#concat').val();
        let phone=$('#phone').val();
        let telephone=$('#telephone').val();
        let qq=$('#qq').val();
        console.log(adComapyName);
        console.log(adComapyUrl);
        console.log(adComapyAddress);
        console.log(concat);
        console.log(phone);
        console.log(telephone);
        console.log(qq);

        // if(!huoDong){
        //     layer.msg("请输入活动名称");
        //     return false;
        // }
        // if(!acTimeStart){
        //     layer.msg("请选择活动开始时间");
        //     return false;
        // }
        // if(vocation=="请选择"){
        //     layer.msg("请选择行业分类");
        //     return false;
        // }
        
        var d = {};
        d.adComapyName = adComapyName;
        d.adComapyUrl = adComapyUrl;
        d.adComapyAddress = adComapyAddress;
        d.concat = concat;
        d.phone = phone; 
        d.telephone = telephone;
        d.qq = qq;

        let token=sessionStorage.getItem("token");
        $.ajax({
            url: url + "/advertiser/adUserInfo/saveOrUpdateAdUser",
            type: 'POST',
            //		参数需转为字符串
            data: JSON.stringify(d),
            //		json跨域
            dataType: 'json',
            //		contentType类型为json
            contentType: "application/json",

            //		请求头加上X-Token 
             beforeSend: function(XMLHttpRequest) {
                //		token 为页面所获取
                   
    			XMLHttpRequest.setRequestHeader("X-Token", token); 
            },
            useDefaultXhrHeader: false,
            success: function(result) {
                console.log(result);
                if(result.code == '0') {
                    queryInfo();
                    layer.open({title: '提示', icon: '1', content:result.msg,time:1500,end:function(){
                        cancel1();                  
                    }});
                } else {
                    isErr(result);
                }
            },
            err: function(err) {
                layer.msg(result.msg);
            },
            complete: function() {
                
            }
        });
    }
    //基本取消触发事件
    function cancel1(){
        $('#zhanShi').removeClass("hide");
        $('#bianJi').addClass("hide");   
    }  
    
    //修改密码取消触发事件
    function cancel2(){

        $('#showPwd').removeClass("hide");
        $('#bianJiPwd').addClass("hide");
    } 

    //修改密码
    function confirm(){

        let oldPwd=$('#oldPwd').val();
        let newPwd=$('#newPwd').val();
        let confirmPwd=$('#confirmPwd').val();
        if(!oldPwd){
            layer.msg("旧密码不能为空");
            return false;
        }

        if(!newPwd){
            layer.msg("新密码不能为空");
            return false;
        }
        if(!confirmPwd){
            layer.msg("确认密码不能为空");
            return false;
        }
        if(confirmPwd!=newPwd){
            layer.msg("两次新密码输入不一致");
            return false;
        }

        let token=sessionStorage.getItem("token");

        var d = {};
        d.newPassword = newPwd;
        d.oldPassword = oldPwd;
        $.ajax({
            url: url + "/sys/password",
            type: 'POST',
            //		参数需转为字符串
            data: JSON.stringify(d),
            //		json跨域
            dataType: 'json',
            //		contentType类型为json
            contentType: "application/json",

            //		请求头加上X-Token 
             beforeSend: function(XMLHttpRequest) {
                //		token 为页面所获取
                   
    			XMLHttpRequest.setRequestHeader("X-Token", token); 
            },
            useDefaultXhrHeader: false,
            success: function(result) {
                console.log(result);
                if(result.code == '0') {
//                      layer.open({title: '提示', icon: '1', content:result.msg,time:1500,end:function(){
//                          $('#oldPwd').val("");
//                          $('#newPwd').val("");
//                          $('#confirmPwd').val("");
//                          cancel2();        
//                        }});
						layer.msg(result.msg,{time:2*1000},function() {
							logout();
						});
                } else {
                    // isErr(result.msg);
                    layer.msg(result.msg);
                }
            },
            err: function(err) {
                layer.msg(result.msg);
            },
            complete: function() {
                
            }
        });
       
    }


</script>
<script>
		$('.user').on('click', function() {
		$(this).toggleClass('hover');
	})
	
	$('.user').mouseleave(function() {
		$(this).removeClass('hover');
	});
</script>
<script src="../../oem/js/oem.js"></script>